home *** CD-ROM | disk | FTP | other *** search
- Path: informatik.tu-muenchen.de!fischerj
- From: fischerj@informatik.tu-muenchen.de (Juergen "Rally" Fischer)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: TMapping again!
- Date: 12 Mar 1996 18:09:21 GMT
- Organization: Technische Universitaet Muenchen, Germany
- Distribution: world
- Message-ID: <4i4ekh$8t4@sunsystem5.informatik.tu-muenchen.de>
- References: <38232442@kone.fipnet.fi> <4h45g4$ije@sunsystem5.informatik.tu-muenchen.de> <xRL9hMD0aRz1@point86.people-s.people.de>
- NNTP-Posting-Host: hphalle10.informatik.tu-muenchen.de
- Originator: fischerj@hphalle10.informatik.tu-muenchen.de
-
-
- In article <xRL9hMD0aRz1@point86.people-s.people.de>, azure@people-s.people.de (Tim Boescke) writes:
- |> Reply to Re: TMapping again! / 29.02.1996
- |> by fischerj@informatik.tu-muenchen.de (Juergen Rally Fischer)
- |> JF> In article <38232567@kone.fipnet.fi>, "Jyrki Saarinen" <jsaarinen@kone.fipnet.fi> writes:
- |> JF> |>
- |> JF> |> > A time ago I did an approach to this problem using a similar trick
- |> JF> |> > than my two-command mapper.
- |> JF> |> > (btw. actually this one WORKS .. I have tried it out)
- |> JF> |> >
- |> JF> |> >
- |> JF> |> > move.l d3,d2 ;d3=d4=0000000000000XXXXXXXxxxxxxYYYYYY
- |> JF> |> > move d0,d5 ;d0=a6=yyyyyyyy000000000000BBBBBBbbbbbb
- |> JF> |> > and.l d6,d2 ;d6= 00000000000001111111000000111111
- |> JF> |> > and.b d7,d5 ;d7= xxxxxxxxxxxxxxxxxxxxxxxx11000000
- |> JF> |> > or d5,d2
- |> JF> |> > move.b (a4,d2.l),(a2)+ ;d2= 00000000000000xxxxxxbbbbbbyyyyyy
- |> JF> |> > add.l a6,d0
- |> JF> |> > addx.l d4,d3
- |> JF> |> >
- |> JF> |> > This one is doing Texturemapping + gouraud shading with
- |> JF> |> > shadetable. (!!)
- |> JF> |> >
- |> JF> |> > The Texture is 64x64 (6 bit) and the shading is 6 bit two. You
- |> JF> |> > will need a 256k combined Texture/Shading table.
- |> JF> |>
- |> JF> |> Hmm. Not nice in a game for example where several textures
- |> JF> |> are needed. But a nice idea anyway!
- |>
- |> YOu can use this code with several textures. For example you could
- |> split up the shading range. For example B=0-31 is textere one and
- |> B=32-63 is Texture two.. etc. or use 32x32 textures...
- |>
- |> JF> nice ? Cooooooool!
- |> JF> Cool idea to pack the shading value into the texture adress!
- |>
- |> Thanks ;)
- |>
- |> JF> The example does too much instructions :) but allows more general
- |> JF> mem usage.
- |> JF>
- |> JF> What about this...
- |> JF>
- |> JF> add.l a2,d2 0...00BBBbbbbbbbbbbbbbbbb
- |> JF> add.l a3,d1 x...xxxxxYYYYYYYYyyyyyyyy
- |> JF> addx.l d3,d0 0...0000000000000XXXXXXXX
- |> JF> move.l d2,d6
- |> JF> move.w d1,d6
- |> JF> move.b d0,d6
- |> JF> move.b 0(a0,d6.l),(a1)+
- |> JF>
- |> JF> 20 cycles gouraud mapping :)
- |> JF>
- |> JF> 8 shadingsteps are 512k, not too much even for a A1200 game imho
- |> JF> (well, people tell me they aim for higher machines anyway,
- |> JF> so the mem consumption can't be considered so bad ;)
- |>
- |> Welll. of course this is two cycles faster, but it takes twice the
- |> memory and 8 shading steps are simply not enough ;)
-
- why twice the mem ?
-
- it can do also 16 steps, just like yours.
- n colors shaded textures, needing 2^(n-1) times more mem, just like yours :)
-
-
- |>
- |> JF> I would really think about using this routine, it's really LOT quicker.
- |> JF> You can put multiple textures into a given 64k range btw. but those can't
- |> JF> be "repeart-mapped" uh "multiplexed" ? how you call it if x gets 256 and then
- |> JF> _plop_, 0 again on the left side ? Is this called bump-mapping ? :D
- |>
- |> wrap-around textures ?? Well erhm.. Bump-mapping is a bit different.
-
- not knowing what it is I can imagine it is a bit different, though the ":D" ;)
- so what is bump-mapping ?
-
- wrap-around: imagine you scan over the border of a 256x256 texture.
- pointer will be in same texture again, beacuse it's all "anded" to 64k.
- you can have multiple times the same texture in one polygon this way.
-
- when using the 256x256 space for storting multiple textures (4 times
- 128x128 etc) you loose "wrap-around" :) Is the word silly ? what you'd use
- for it ?
-
-
- |> (hehe found a nice and fast innerloop for that, too. ;) )
- |>
- |> --
- |> +--------------------------------------------------------------------+
- |> | - AZURE@PEOPLE-S.people.de - Tim Boescke - AZURE /atw.bzr |
- |> +---------------------------------<AMIGA,PC,C64,PLUS/4,VCS2600>------+
- ------------------------------------------------------------------------
- fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer) =:)
-
-